import { Canvas } from "@/canvas.js";
import data from "@/utils/data.js";
import * as math from "mathjs";

// math.add(加)
// math.subtract(减)
// math.multiply(乘)
// math.divide(除)

const canvas = new Canvas("#canvas");
canvas.add(data);

const c = [
  [2, 0, 1],
  [4, 4, 1],
];
const d = math.matrix([
  [1, 0, 0],
  [0, 1, 0],
  [3, 3, 1],
]);
console.log("精度计算: 0.1+0.2 =", math.format(math.evaluate("0.1+0.2"), { precision: 14 }));
console.log(math.multiply(c,d)._data.map(i => [i[0], i[1]]))